package com.itheima.d1_serializable;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 * 对象反序列化，将对象从指定文件读取出来
 */
public class test2 {
    public static void main(String[] args) throws Exception {
        //1.创建管道
        ObjectInputStream is = new ObjectInputStream(new FileInputStream("E:\\java project\\opp-app3\\project\\src\\obj.txt"));

        //2.调用方法
        student s =(student) is.readObject();

        System.out.println(s);
    }
}
